home *** CD-ROM | disk | FTP | other *** search
/ Reverse Code Engineering RCE CD +sandman 2000 / ReverseCodeEngineeringRceCdsandman2000.iso / RCE / Library / Manuels & Misc / Smartcheck / nm!sc-tut.txt next >
Encoding:
Text File  |  2000-05-25  |  5.5 KB  |  107 lines

  1. Numega Smartcheck 5.0
  2.  
  3. Beginners Guide
  4.  
  5.  
  6. Target:
  7. Braga.exe - Braga's Little Crackme 1 in Visual Basic 5
  8.  
  9. Tools:
  10. Smartcheck 5.  ftp search for smchk50.exe
  11.  
  12. While there are a few tutorials on Smartcheck at fravia.org, they didn't
  13. really help me to get started with SC, hopefully this tutorial will help you
  14. in learning this fantastic tool. This tut is to help you figure the basics, rather than
  15. just telling you how to complete braga's crackme.
  16.  
  17. For those of you who are not familiar with SC, and what it is, heres a description
  18. from the Main Help File:
  19.  
  20. SmartCheck is a run-time debugging tool that addresses the most problematic conditions encountered by Visual Basic developers:
  21.  
  22. ╖    Fatal run-time errors that are cryptic and hard-to-solve
  23. ╖    Problems that result from a sequence of events
  24. ╖    Incorrect Windows API Usage from Visual Basic
  25. ╖    Bad values passed to built-in Visual Basic functions
  26. ╖    Problematic value coercions
  27. ╖    Errors in components, such as ActiveX controls, used by your program
  28.  
  29. heh heh, well, not only can you use smartcheck for finding errors in your
  30. Visual Basic programs, you can also use SC to find out exactly what somebody
  31. elses program is doing, whether it is written in Visual Basic or not.Infact, 
  32. heres news for all you crackers out there that hate cracking VB5 apps:
  33. SC makes it FUN!!
  34.  
  35.  
  36. Ok, enough of the intro.  After you have run the setup program (and found
  37. the required password using sice)  start Smartcheck.  In the File menu, select
  38. open, and open braga.exe.  Then, in the Program menu, select settings.
  39. Change whatever you have to this:
  40.  
  41. All the chack boxes in the Error Detection tab should be checked.
  42.  
  43. In Advanced, in the Error Detection tab, the first 4 checkboxes should
  44. be checked, the rest shouldnt be checked.  Make sure 'Suppress API Calls' is NOT checked.
  45.  
  46. In the Reporting tab, everything except 'Report mousemove events from
  47. OCX' should be checked.
  48.  
  49. Phew! Ok, now, press the green 'play' button and let the fun begin.  Hopefully,
  50. a new window will be opened in SC, split into three sections.  The bottom section, we dont
  51. have to worry about, because we normally wont have the Source Code of our
  52. targets programs.  In this should read: "No source file".
  53.  
  54. In the section above that, on the left hand side, you should have many lines of
  55. function calls, clicking on one reveals more details in the right hand section.
  56. One of the function calls you should see, the first one on the list, is
  57. InitializeCriticalSection(PTR: xxxxxxxx)
  58. If you look down the very bottom right hand corner of the main SC window, you
  59. should see how many program events have occured.  I have 1360, from just loading
  60. braga.exe.  In the View menu, select Show All Events.  When you get to know sc more,
  61. you can experiment with the Specific Events (The Object Events is usually good
  62. for our needs.) 
  63.  
  64. OK, Braga's crackme should have loaded, so enter a dummy name and serial, and
  65. click Register.  You will probably now have a Dlg box saying "Keep Trying :)))"
  66. Well, lets see what Smartcheck has given us.  Search for the first 4 characters of whatever 
  67. name you entered (for me, i entered night_mastah[mgm], so i searched for nigh).
  68.  
  69. The Program Results section should now be sitting at a 
  70. __vbaVarMove(VARIANT:String:"night_m",VARIANT:Empty) returns DWORD:63F35C
  71.  
  72. Well, it doesnt exactly take a genius to figure out whats happening here.  You can see, your name has
  73. been taken and placed at mem location 63F35C or whatever.  Follow the Program Results down, and it should
  74. really speak for itself.
  75.  
  76. It gets your serial, and keeps it for later.  It then finds the LENgth of
  77. your name, then finds the LEFTmost character, for me it was 'n'. It then finds
  78. the Ascii value for that letter, then changes this to HEX (6E).  Then, the program finds the first 4 letters
  79. of your name, although I dont think what happens next is what Braga intended.  I think, 
  80. by looking at the output from SC, he intended to find the ascii value for the first 4 letters
  81. of your name, but all the program does is (again) find the Ascii value for the first letter. It then changes this to
  82. to HEX aswell.
  83.  
  84. Scrolling down further, you should come to the __vbaVarCat section, where the crackme works out
  85. the correct serial.  Again, its fairly easy to work out whats happening, but if its not, let me explain:
  86. 1) It takes the hex value for the first letter of your name, then adds a '-'
  87. 2)On the end of that, it adds the string 'Pt-Cracker', and another '-' (the string is now 'xx-Pt-Cracker-'  where xx is the hex val etc.
  88. 3)It then adds the HEX value again for the first letter of your name (although I dont think he meant that, maybe...) 'xx-Pt-Cracker-xx
  89. 4)Then, another '-' is added to the string. 'xx-Pt-Cracker-xx-'
  90. 5)Finally, he adds 12345 to the string. The Final String is: 'xx-Pt-Cracker-xx-12345'
  91.  
  92. Scroll down another few lines, and you will find __vbaVarTstEq(VARIANT:String:"111222333444555", VARIANT:String:"6E-Pt-Cracker-6E-12345")
  93.                                          ^^^^^^^^^^^^^ or whatever you entered as your serial.
  94.  
  95. Again, no prizes for guessing what thats about.  If you favour patching the crackme, in Wdasm, the address you should start looking at is
  96. !0040239E (__vbaVarTstEq() location)
  97. To convert the address from SC to Wdasm, if the address has 000, change that to: 004.
  98.  
  99. Hopefully this small tutorial has helped you figure out the basics of Smartcheck 5.0.
  100.  
  101. If you this tutorial has helped you, please repay the favour by saying "Hi" to me (night_mas)
  102. on #Cracking4newbies or #Magnum on Effnet.
  103.  
  104. See ya
  105.  
  106. night mastah
  107. magnum 98